<!--
 * @Descripttion:安装设备列表
 * @version: 
 * @Author: gonghong
 * @Date: 2023-07-07 09:31:41
-->
<script setup >
import { toPageAuth  } from '@/common/utils'
const props=defineProps({
    item:{
        type:Object,
        default:()=>{
            return {}
        }
    }
})

/**
 * @name 跳转安装设备页面
 * @return {*}
 */
const installOnClick=()=>{
    toPageAuth(
        `/homePages/installDevice/index`,
        (res)=>{
            res.eventChannel.emit('getData', props.item)
        }
    )
}
</script>
<template>
    <uni-card
        :title="item.deviceName" 
        
    >
        <view class="listCard">
            <cell class="f-df f-jc-b">
                <text>设备编码:</text>
                <text>{{  item.deviceCode||'无' }}</text>
            </cell>
            <cell class="f-df f-jc-b">
                <text>用户名称:</text>
                <text>{{  item.userName||'无' }}</text>
            </cell>
            <!-- <cell class="f-df f-jc-b">
                <text>阀门名称:</text>
                <text>{{  item.valveName||'无' }}</text>
            </cell>
            <cell class="f-df f-jc-b">
                <text>阀门位置:</text>
                <text>{{  item.valveInstallationPositionName||'无' }}</text>
            </cell> -->
            <cell class="f-df f-jc-b">
                <text>手机号:</text>
                <text>{{  item.phoneNo||'无' }}</text>
            </cell>
            <cell class="f-df f-jc-b">
                <text>安装位置:</text>
                <text>{{  item.installationPositionName||'无' }}</text>
            </cell>
            <cell class="f-df f-jc-b">
                <text>安装时间:</text>
                <text>{{  item.installationTime||'无' }}</text>
            </cell>
            <view style="diplay:flex;word-break: break-all;" class="f-df f-jc-b">
                <text>用户地址:</text>
                <text style="flex:1;text-align: right;">
                    {{  `${item.cityName||''}${item.areaName||''}${item.buildName||''}${item.unitName||''}${item.addr||''}` }}
                </text>
            </view>
        </view>
        <view class="btn-box" v-if="item.installationStatus==='1'?false:true">
            <view class="primaryBtn" @click="installOnClick">
                <!-- <uni-icons type="trash" size="18" color="#fff"></uni-icons> -->
                <text >安装</text>
            </view>
        </view>
        <!-- <view slot="actions" class="card-actions" v-if="item.installationStatus==='1'?false:true">
            <view class="card-actions-item">
                <uni-icons type="trash" size="18" color="#999"></uni-icons>
                <text class="card-actions-item-text">删除</text>
            </view>
            <view class="card-actions-item" @click="installOnClick">
                <uni-icons type="gear-filled" size="18" color="#999"></uni-icons>
                <text class="card-actions-item-text">安装</text>
            </view>
        </view> -->
    </uni-card>
</template>

<style lang="scss" scoped>
.listCard{
    display: flex;
    flex-direction: column;
}

.card-actions{
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    height: 45px;
    border-top: 1px #eee solid;
    .card-actions-item{
        display: flex;
        flex-direction: row;
        align-items: center;
        .card-actions-item-text{
            font-size: 12px;
            color: #666;
            margin-left: 5px;
        }
    }
}
.btn-box{
    display: flex;
    justify-content: flex-end;
    margin-top:24upx;
}

</style>